package yangsw87.basic;

public class J10_Ex74_OOPb {

	public static void main(String[] args) {

		Account a = new Account();

		a.setAid(1122);
		a.setBalance(20000);
		a.setInterestRate(4.5);
		a.setDateCreated("2014-08-15 14:34:29");
		a.getMonthlyInterestRate();
		System.out.println(a.toString());

	}

}

class Account {
	private int aid;
	private int balance;
	private double interestRate;
	private String dateCreated;
	double MonthlyInterestRate;

	public void setAid(int aid) {
		this.aid = aid;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

	public void setInterestRate(double interestRate) {
		this.interestRate = interestRate;
	}

	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}

	// setter

	public int getAid() {
		return aid;
	}

	public int getBalance() {
		return balance;
	}

	public double getInterestRate() {
		return interestRate;
	}

	public String getDateCreated() {
		return dateCreated;
	}

	// getter

	void getMonthlyInterestRate() {
		MonthlyInterestRate = interestRate / 12;
	}

	@Override
	public String toString() {
		String result = "";
		result = result + "계좌번호 : " + aid + "\n";
		result += "통장잔액 : " + balance + "\n";
		result += "연간 이자율 : " + interestRate + "\n";
		result += "통장개설 날짜 : " + dateCreated + "\n";
		result += "월간 이자율 : " + MonthlyInterestRate;
		return result;
	}
}
